<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>Test</title>
        <link rel="stylesheet" type="text/css" href="App.css" />
        <link rel="stylesheet" type="text/css" href="css/ext-all.css" />
        <script type="text/javascript" src="js/ext-base-debug.js"></script>
        <script type="text/javascript" src="js/ext-all-debug-w-comments.js"></script>
        <link rel="stylesheet" type="text/css" href="css/ux-all.css" />
        <script type="text/javascript" src="js/ux-all-debug.js"></script>
        <script type="text/javascript" src="ui/ui.js"></script>
        <script type="text/javascript" src="ui/StatusBar.js"></script>
        <script type="text/javascript" src="ui/Panel.js"></script>
        <script type="text/javascript" src="ui/Window.js"></script>
        <script type="text/javascript" src="ui/ProcessStatusManager.js"></script>
        <script type="text/javascript" src="ui/MessageBox.js"></script>
    </head>
    <body>
        <script>
            Ext.BLANK_IMAGE_URL = '/extjs/resources/images/default/s.gif';

            Ext.onReady(function(){		
                var panel;
                var win = new QFinance.ui.Window({
                    width: 400,
                    height: 400,
                    maximizable: true,
                    mask: {
                        enabled: true
                    },
                    tbar: [{
                            text: 'Start 5',
                            handler: function() {
                                win.processStatusManager.start.defer(100, win.processStatusManager, ['1', [win]]);
                                win.processStatusManager.start.defer(300, win.processStatusManager, ['2', [win]]);
                                win.processStatusManager.start.defer(500, win.processStatusManager, ['3', [win]]);
                                win.processStatusManager.start.defer(700, win.processStatusManager, ['4', [win]]);
                                win.processStatusManager.start.defer(900, win.processStatusManager, ['5', [win]]);
                            }
                        }],
                    bbar: new QFinance.ui.StatusBar({
                        items: [{
                                text: 'Stop 5',
                                handler: function() {
                                    win.processStatusManager.success.defer(100, win.processStatusManager, ['1']);
                                    win.processStatusManager.success.defer(300, win.processStatusManager, ['2']);
                                    win.processStatusManager.success.defer(500, win.processStatusManager, ['3']);
                                    win.processStatusManager.success.defer(700, win.processStatusManager, ['4']);
                                    win.processStatusManager.success.defer(900, win.processStatusManager, ['5']);
                                }
                            },{
                                text: 'Stop 5e',
                                handler: function() {
                                    win.processStatusManager.success.defer(100, win.processStatusManager, ['1']);
                                    win.processStatusManager.success.defer(300, win.processStatusManager, ['2']);
                                    win.processStatusManager.error.defer(500, win.processStatusManager, ['3', 'Error message']);
                                    win.processStatusManager.success.defer(700, win.processStatusManager, ['4']);
                                    win.processStatusManager.success.defer(900, win.processStatusManager, ['5']);                                     
                                }
                            },{
                                text: 'Stop 5i',
                                handler: function() {
                                    win.processStatusManager.success.defer(100, win.processStatusManager, ['1']);
                                    win.processStatusManager.success.defer(300, win.processStatusManager, ['2']);
                                    win.processStatusManager.success.defer(500, win.processStatusManager, ['3', 'Info message']);
                                    win.processStatusManager.success.defer(700, win.processStatusManager, ['4']);
                                    win.processStatusManager.success.defer(900, win.processStatusManager, ['5']);                                                              
                                }
                            },{
                                text: 'Stop 5ie',
                                handler: function() {
                                    win.processStatusManager.success.defer(100, win.processStatusManager, ['1']);
                                    win.processStatusManager.success.defer(300, win.processStatusManager, ['2']);
                                    win.processStatusManager.success.defer(500, win.processStatusManager, ['3', 'Info message']);
                                    win.processStatusManager.error.defer(700, win.processStatusManager, ['4', 'Error message']);
                                    win.processStatusManager.success.defer(900, win.processStatusManager, ['5']);                                                                                                 
                                }
                            }]
                    }),
                    items: [ panel = new QFinance.ui.Panel({
                        layout: 'fit',
                        autoSize: true,
                        ownerWindow: win,
                        tbar: [{
                            text: 'Start 3',
                            handler: function() {
                                panel.getProcessStatusManager().start.defer(100, panel.processStatusManager, ['6', [panel]]);
                                panel.getProcessStatusManager().start.defer(100, panel.processStatusManager, ['7', [panel]]);
                                panel.getProcessStatusManager().start.defer(100, panel.processStatusManager, ['8', [panel]]);
                            }
                        },{
                            text: 'Show message',
                            handler: function() {
                                var messageBox = new QFinance.ui.MessageBox();
                                messageBox.show({					
                                    title: 'Title',
                                    buttons: messageBox.OK,
                                    icon: messageBox.ERROR,
                                    msg: 'message',
                                    renderTo: panel.getOwnerWindow().body,
                                    modal: true,
                                    constrain: false,
                                    minWidth: 200
                                }); 
                            }
                        },{
                            text: 'Show window',
                            handler: function() {
                                var win2 = new QFinance.ui.Window({
                                    width: 200,
                                    height: 200,
                                    ownerWindow: panel.getOwnerWindow(),
                                    items: [{                                     
                                            html: 'a'
                                    }] 
                                });
                                win2.show();
                            }
                        }],
                        bbar: [{
                            text: 'Stop 3',
                            handler: function() {
                                panel.getProcessStatusManager().success.defer(100, panel.processStatusManager, ['6']);
                                panel.getProcessStatusManager().success.defer(100, panel.processStatusManager, ['7']);
                                panel.getProcessStatusManager().success.defer(100, panel.processStatusManager, ['8']);
                            }
                        }],
                        items: [{
                            html: 'a'
                        }]
                    })]
                });
                win.show();
            });
        </script>
    </body>
</html>
